﻿using System;
using System.Collections.Generic;

namespace FileSystemControls.ListViewItems
{
    public class FileInfoItemCollection<T> : List<T> where T : FileSystemListViewItem
    {
        public new void Add(T argItem)
        {
            argItem.IsMarked = true;
            base.Add(argItem);
        }

        public new void Remove(T argItem)
        {
            argItem.IsMarked = false;
            base.Remove(argItem);
        }

        public new void Clear()
        {
            foreach (T CurrentItem in this)
            {
                CurrentItem.IsMarked = false;
            }

            base.Clear();
        }

        public List<String> FilenameList
        {
            get
            {
                List<String> nameList = new List<string>();
                foreach (T currentFile in this)
                {
                    nameList.Add(currentFile.FullPath);
                }
                return nameList;
            }
        }
    }
}

//TODO: 004 - Add to FileSystemListViewItemCollection if there is a need. Investigate the Engine and determine if this will help
//protected FileSystemListViewItem Contains(string QuestionPath)
//{
//    foreach (FileSystemListViewItem CurrentItem in this.Items)
//    {
//        if (QuestionPath == CurrentItem.FullPath)
//        {
//            return CurrentItem;
//        }
//    }
//    return null;
//}
